<% @page_title = "Edit book information" %>
<%= stylesheet_link_tag "admin/form", :media => "all" %>
<style>
	p img {
		width: 200px;
		height: 250px;
		box-shadow: 1px 1px 4px #000;
		-webkit-box-shadow: 1px 1px 4px #000;
		-moz-box-shadow: 1px 1px 4px #000;
	}
</style>

<div class="edit-book-form">
<h1>Edit book information</h1>
<%= form_tag({:action => 'update', :id => @book.id}, :multipart => true ) do %>
    <p><label for="book_title">Title</label><%= text_field 'book', 'title' %></p>

     <p><label for="book_author">Author</label><%= text_field 'book', 'author' %></p>
 
  	<p><label for="book_publisher">Publisher</label><%= text_field 'book', 'publisher' %></p>
 
     <p><label for="book_price">Price</label><%= text_field 'book', 'price' %></p>
 
     <p><label for="book_quantity">Quantity</label><%= text_field 'book', 'quantity' %></p>
  
     <p><label for="book_description">Description</label><%= text_field 'book', 'description' %></p>
 
     <p><label for="book_available">Available Quantity</label><%= text_field 'book', 'free_quantity' %></p>
 
     <p><label for="book_category">Category</label><%= collection_select(:book,:book_category_id,@categories,:id,:category_name) %></p>
 	
 	<p><label for="book_image_url">Image</label><%= image_tag(@book.image_url) %></p>
 	<p><label>&nbsp;</label><%= file_field 'book', 'image_url' %></p>
 	
   <p class='action'><label>&nbsp;</label><%= submit_tag "Save Changes" %><%= link_to "Back", :controller => "admin/user", :action => "index" %></p>
<% end %>
</div>